import { _decorator, Component, Node } from 'cc';
import { GGStore } from '../framework/core/base/GGStore';
import { GAME_INFOS } from './Enums';
const { ccclass, property } = _decorator;

export default class DataMgr {
    // 颜色池子
    static colorPool: number[][] = []
    // 当前关卡
    static currentLevel:number = 1

    // 游戏倒计时
    static countDown: number = -1

    // 是否使用锤子道具
    static isUsingHammer: boolean = false
    // 是否使用交换道具
    static isUsingExchange: boolean = false
    // 体力数量
    static currentStamina: number = GGStore.get(GAME_INFOS.SAVE_STAMINA, 6)

    // 从颜色池子中取出颜色
    static getColors(): number[] {
        if (DataMgr.colorPool.length > 0) {
            const arr = []
            for (var i = 0; i < DataMgr.colorPool[0].length; i++) {
                arr.push(DataMgr.colorPool[0][i])
            }

            DataMgr.colorPool.splice(0, 1)
            return arr
        } else {
            return []
        }
    }
}
